{template Public:Page:header}

<form id="VerifyForm">
<div class="container">
     <div class="row">
         
               <div class="widget radius-bordered">
                    <div class="widget-header"> <span class="widget-caption"><i class="glyphicon glyphicon-user"></i> 验证找回密码</span> </div>
                    <div class="widget-body">
                         <div class="row">
                              <div class="col-lg-12">
                              			<div class="alert alert-info fade in">
                                            <button data-dismiss="alert" class="close">
                                                ×
                                            </button>
                                            <i class="fa-fw fa fa-info"></i>
                                            <strong>提示!</strong> 验证成功后新密码发到您找回密码的邮箱或手机上。
                                        </div>
                              			<div class="col-lg-6" style="padding-left:38px;">
             							<div class="form-group has-feedback">
                                               <div class="input-group">
                       
                                                     <span class="input-group-addon ">验证码</span><input type="text" name="code" value="" class="form-control" data-bv-notempty="true" data-bv-notempty-message="<i class='fa fa-frown-o'></i> 对不起,请输入激活码！" data-bv-regexp="true" data-bv-regexp-regexp="^[a-zA-Z0-9]+$" data-bv-regexp-message="<i class='fa fa-frown-o'></i> 对不起,请输入激活码格式有误！" data-bv-field="code"> 
                                                     <div class="input-group-btn"><button class="btn btn-success shiny  control-label" type="submit">提交验证</button></div>
                                              
                                         		</div>
                                        </div>
                                        </div>
                                        <div class="col-lg-12" style="padding-left:38px; padding-top:10px; padding-bottom:20px;">{hook VerifyCode}</div>
                                    
                                       <div class="col-lg-11" style="padding-left:42px;">
                                         <div class="form-group">
                                          <input  type="hidden" value="json" name="datatype"/>
                                          <input name="id" type="hidden" value="{echo $id}"/>
                                          <button class="btn btn-primary" type="submit">提 交</button>
                                        </div>
                                      </div>
                                       
                              </div>
                         </div>
                    </div>
              
          </div>
     </div>
</div>
</form>

<script src="/assets/js/validation/bootstrapValidator.js"></script>

<script>

$(document).ready(function () {

	  $('#VerifyForm').bootstrapValidator({
			excluded: [':disabled'],
			feedbackIcons: {
				valid: 'glyphicon glyphicon-ok',
				invalid: 'glyphicon glyphicon-remove',
				validating: 'glyphicon glyphicon-refresh'
			},
			submitHandler: function (form) {

			   $.post('{echo U("/get/forgotpassword/verify")}',$("#VerifyForm").serialize(), function(json) {
	
					bootbox.hideAll();
					
					bootbox.dialog({  
						message: json.message,  
						title: json.title,  
						buttons: {  
							OK: {  
								label: "确定",  
								className: "btn-primary",  
								callback: function () {  
									if(json.status=='ok'){
										window.location.href='/login';
									}else{
										bootbox.hideAll();
									}
								}  
							}  
						}  
					});  
		
					return true;
				
			  }, 'json');
			  
		
			 bootbox.dialog({
				 message: '<div class="progress progress-striped active"><div style="width: 1%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="20" role="progressbar" class="progress-bar progress-bar-info"><span>0%</span></div></div>',
				 title: '<i class="icon fa fa-retweet"></i> 验证中',
				 closeButton: false
			 }).PhpappProgress({time:5000});
		 
			  return false; 
			}
		
		}) 

});

</script>


{template Public:Page:footer}